import {defaultRequest} from "@/network";

export function queryForPage(queryPage) {
  return defaultRequest({
    method: "POST",
    data: queryPage,
    url: "/category/page"
  });
}

export function findById(id) {
  return defaultRequest({
    method: "GET",
    url: "/category/" + id
  });
}

export function findAll() {
  return defaultRequest({
    method: "GET",
    url: "/category"
  });
}

export function deleteById(id) {
  return defaultRequest({
    method: "POST",
    params: {id},
    url: "/category/delete"
  });
}

export function saveOrUpdate(categoryInfo) {
  return defaultRequest({
    method: "POST",
    data: categoryInfo,
    url: "/category/save"
  });
}
